package mytf.core.toolbox;

import java.util.HashSet;
import java.util.Set;

/**
 * @author chuc
 *
 */
public class LinkQ {
	private static Set visitedUrl = new HashSet();
	private static MyQ unVisitedUrl = new MyQ();
	
	public static Set getVisitedUrl() {
		return visitedUrl;
	}
	
	public static void addVisitedUrl(String url){
		visitedUrl.add(url);
	}
	
	public static  void removeVistedUrl(String url){
		visitedUrl.remove(url);
	}
	
	public static Object unVisitedDeQueue(){
		return unVisitedUrl.deQueue();
	}
	
	public static void addUnVisitedUrl(String url){
		if(url!=null && !url.trim().equals("")  
			&& !unVisitedUrl.contians(url)
			&& !visitedUrl.contains(url))
			unVisitedUrl.enQueue(url);
	}
	
	public static int getVisitedNum(){
		return visitedUrl.size();
	}
	
	public static boolean isUnVisitedUrlEmpty(){
		return unVisitedUrl.isEmpty();
	}
	
	public static MyQ getUnVisitedUrl() {
		return unVisitedUrl;
	}
	
	 
}
